<?php
       $productscart = $product->selectcart($_GET['name']);
        if(!empty($_GET["quantity"])){
            $itemArray = array($productscart[0]['name']=>array('name'=>$productscart[0]['name'], 'quantity'=>$_GET['quantity'], 'price'=>$productscart[0]['price'], 'image'=>$productscart[0]['image']));
            if(!empty($_SESSION['cartitem']))
            {
                if(in_array($productscart[0]['name'],$_SESSION['cartitem']))
                {
                    
                }else{
                    $_SESSION['cartitem'] = array_merge($_SESSION['cartitem'],$itemArray);
                }
            }
            else
            {
                $_SESSION['cartitem'] = $itemArray;
            }
        }
?>